package data.visu.enums;

import data.Constants;
import data.visu.structures.ValueAndString;

/**
 * @author Charles Perin
 * 29 mars 2011
 * LIMSI - INRIA Rennes
 * charles.perin@free.fr
 *
 */
public enum E_BandTypes {

	CAMERA_DYNAMICITY(false,new ValueAndString[]{
			Constants.BAND_CAMERA_DYNAMICITY_NONE, 
			Constants.BAND_CAMERA_DYNAMICITY_ORIENTATION,
			Constants.BAND_CAMERA_DYNAMICITY_POSITION_AND_ORIENTATION,
			Constants.BAND_CAMERA_DYNAMICITY_FULL
	}),
	CAMERA_DISTANCE_TO_ACTORS(false,new ValueAndString[]{
			Constants.BAND_CAMERA_DISTANCE_TO_ACTORS_EXTREME_CLOSE_UP,
			Constants.BAND_CAMERA_DISTANCE_TO_ACTORS_CLOSE_UP,
			Constants.BAND_CAMERA_DISTANCE_TO_ACTORS_MEDIUM_SHOT,
			Constants.BAND_CAMERA_DISTANCE_TO_ACTORS_LONG_SHOT,
			Constants.BAND_CAMERA_DISTANCE_TO_ACTORS_EXTREME_LONG_SHOT
	}),

	CAMERA_AXE(false,new ValueAndString[]{
			Constants.BAND_CAMERA_AXE_LOW_ANGLE,
			Constants.BAND_CAMERA_AXE_NEUTRAL,
			Constants.BAND_CAMERA_AXE_HIGH_ANGLE
	}),
	
	TRANSITION_TYPE(false,new ValueAndString[]{
			Constants.BAND_TRANSITION_TYPE_CUT,
			Constants.BAND_TRANSITION_TYPE_CONTINUITY,
			Constants.BAND_TRANSITION_TYPE_DISSOLVE,
			Constants.BAND_TRANSITION_TYPE_FADE_IN,
			Constants.BAND_TRANSITION_TYPE_FADE_OUT
	});


	private ValueAndString[] values;
	private boolean isComparable;

	E_BandTypes(boolean isComparable, ValueAndString[]values){
		setValues(values);
		setComparable(isComparable);
	}

	public void setValues(ValueAndString[] values) {
		this.values = values;
	}

	public ValueAndString[] getValues() {
		return values;
	}

	public boolean isComparable() {
		return isComparable;
	}


	public void setComparable(boolean isComparable) {
		this.isComparable = isComparable;
	}

	public static ValueAndString getValueAndStringFromTypeAndValue(E_BandTypes subType, int value) {
		if(value>-1){
			ValueAndString[] tab = subType.getValues();
			if(value>tab.length-1)return tab[tab.length-1];
			return tab[value];
		}
		else return new ValueAndString(-1, "");
	}
}
